package com.example.recuitactivity.bean;

import com.example.recuitactivity.helper.DbOpenHelper;
import com.example.recuitactivity.observe.AbstractObserver;

public class Candidate extends AbstractObserver {
    private int id;
    private String username;
    private String password;
    private String telephone;
    private String sex;
    private String status;
    private int updateFlag;//0：岗位都浏览过     1：仍存在未被浏览的岗位

    public Candidate(String username, String password, String telephone, String sex,int updateFlag) {
        this.username = username;
        this.password = password;
        this.telephone = telephone;
        this.sex = sex;
        this.status="candidate";
        this.updateFlag=updateFlag;
    }

    public Candidate(int id,String username, String password, String telephone, String sex,String status,int updateFlag) {
        this.id=id;
        this.username = username;
        this.password = password;
        this.telephone = telephone;
        this.sex = sex;
        this.status=status;
        this.status="candidate";
        this.updateFlag=updateFlag;
    }

    public int getUpdateFlag() {
        return updateFlag;
    }

    public void setUpdateFlag(int updateFlag) {
        this.updateFlag = updateFlag;
    }

    public Candidate() {
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public void update(DbOpenHelper dbOpenHelper){
        dbOpenHelper.updateCandidateFlagByCid(id,1);//置状态为有收藏的岗位更新
    }
}
